package com.sk.bilibili.model.fragment.rank;

import com.sk.api.annotations.Autowired;
import com.sk.bilibili.bean.Focus;
import com.sk.bilibili.callBack.RequestCallBack;
import com.sk.bilibili.mapper.FocusMapper;
import com.sk.bilibili.mapper.VideoSetMapper;
import com.sk.bilibili.model.BaseRefreshModel;
import com.sk.bilibili.utils.RequestUtils;
import com.sk.bilibili.view.fragment.rank.FullVideoSetFragment;

public class VideoSetModel extends BaseRefreshModel<FullVideoSetFragment> {

    @Autowired
    VideoSetMapper videoSetMapper;
    @Autowired
    FocusMapper focusMapper;
    private int size=70;

    public void refresh(Integer typeId) {
        RequestUtils.process(videoSetMapper.getRank(size, typeId), videoSets -> view.refreshSuccess(videoSets));
    }

    public void switchFocus(Integer id) {
        RequestUtils.process(focusMapper.switchFocus(id), focus -> {
            view.switchFocusSuccess(focus);
        });
    }
    
}